package com.macro.mall.portal.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.portal.service.OmsPortalOrderService;
import com.macro.mall.portal.vo.PayResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private OmsPortalOrderService orderService;
    @PostMapping("/success")
    public String success(@RequestBody PayResultVO payResultVO){
        //{upOrderId=91295203696770289664,
        // payoffType=null,
        // payTime=2020-08-17 11:40:00,
        // openid=2088522355207274,
        // sign=1B742FBCDB066BFB1219ABF214A622F4,
        // settlementChannel=038,
        // lowOrderId=202008171138,
        // payMoney=0.01,
        // merchantId=620011700051319,
        // state=0, orderDesc=支付成功,
        // account=157922801856307,
        // channelId=ZFB}
        System.out.println("1111111");
        System.out.println(payResultVO);
        orderService.updatePay(payResultVO);
        return "SUCCESS";
    }
//    @PostMapping("")
//    public CommonResult
}
